import { List, Avatar } from 'antd';
import type { userAPI } from '@/models/models';

interface IProps {
  title: string;
  userList: userAPI.userDataItem[];
}

function UserNodeTpl(props: IProps) {
  console.log('props', props);
  const { title, userList } = props;
  return (
    <div>
      <List
        header={title}
        bordered
        itemLayout="horizontal"
        dataSource={userList}
        renderItem={(item) => (
          <List.Item>
            <List.Item.Meta
              avatar={<Avatar src={item.avatar} />}
              title={<a href="#">{item.name}</a>}
              description={item.address}
            />
          </List.Item>
        )}
      />
    </div>
  );
}

export default UserNodeTpl;
